package Filter;

import javax.servlet.*;
import java.io.IOException;

public class Filter1 implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {

        System.out.println("Filter1的前置代码");
        filterChain.doFilter(servletRequest,servletResponse);
        /*
                1.执行完前一个之后，执行后面的Filter过滤器(如果有);
                2.执行目标资源(如果前面没有Filter过滤器)
        * */
        System.out.println("Filter1的后置代码");
    }
}
